<%--
  Created by IntelliJ IDEA.
  User: zjy
  Date: 2015/4/13
  Time: 16:37
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<t:base type="jquery,easyui,tools"/>
<div class="easyui-layout" fit="true">
  <div region="center" style="padding:1px;">
    <t:datagrid name="bankList" title="" actionUrl="bankController.do?datagrid" idField="id" fit="true" queryMode="group">
      <t:dgCol title="id" field="id" hidden="true"></t:dgCol>
      <t:dgCol title="银行名称" field="name" query="true" width="1"></t:dgCol>
      <t:dgCol title="银行logo" field="logo" image="true" imageSize="30,30" width="1"></t:dgCol>
      <t:dgCol title="银行卡背景图片" field="backgroup" image="true" imageSize="200,100" width="2"></t:dgCol>
      <t:dgCol title="创建时间" formatter="yyyy-MM-dd hh:mm:ss" field="createTime" ></t:dgCol>

      <t:dgCol title="common.operation" field="opt" width="1"></t:dgCol>
      <t:dgDelOpt url="articleController.do?delArticle&id={id}" title="删除"></t:dgDelOpt>

      <t:dgToolBar title="新增" icon="icon-add" url="bankController.do?addorupdateView" funname="add"  width="600" height="500"></t:dgToolBar>
      <t:dgToolBar title="修改" icon="icon-edit" url="bankController.do?addorupdateView" funname="f_updateBankfInfo"  width="600" height="500"></t:dgToolBar>
      <t:dgToolBar title="预览" langArg="common.user" icon="icon-search" url="bankController.do?bankController&id=" funname="f_openPreview"  width="850" height="600"></t:dgToolBar>
      <%--<t:dgToolBar title="查看" icon="icon-search" url="sArticleController.do?addorupdate&search=search" funname="detail"  width="800" height="630"></t:dgToolBar>--%>
    </t:datagrid>
  </div>
</div>
<script type="text/javascript">
  function f_updateBankfInfo(title, url, id, width, height) {
    gridname=id;
    var rowsData = $('#'+id).datagrid('getSelections');
    if (!rowsData || rowsData.length==0) {
      tip('请选择编辑项目');
      return;
    }
    if (rowsData.length>1) {
      tip('请选择一条记录再编辑');
      return;
    }

    url += '&id='+rowsData[0].id;
    createwindow(title, url, width, height);
  }
</script>
